<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="#">首页</a>
                        </li>
                        <li class="">
                            <a href="/luckydog/item/index">品牌主理人展板</a>
                        </li>
                        <li class="active">
                        </li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->
                <!-- Page Header -->
                <div class="page-header position-relative">
                    <div class="header-title">
                            <p style="font-weight: bolder;font-size: 19px;margin-top: 10px;">
                            </p>
                    </div>
                    <!--Header Buttons-->
                    <div class="header-buttons">
                        <a class="sidebar-toggler" href="#">
                            <i class="fa fa-arrows-h"></i>
                        </a>
                        <a class="refresh" id="refresh-toggler" href="">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                        <a class="fullscreen" id="fullscreen-toggler" href="#">
                            <i class="glyphicon glyphicon-fullscreen"></i>
                        </a>
                    </div>
                    <!--Header Buttons End-->
                </div>
                <!-- /Page Header -->
                <!-- Page Body -->
                <div class="page-body">
                    <div class="row">
                        <div class="col-xs-12 col-md-12">
                            <div class="tab-content tabs-flat no-padding">
                                <div id="visits" class="tab-pane active animated fadeInUp">
                                    <div class="row">
                                        <div class="col-lg-12 chart-container">
                                            <div id="dashboard-chart-visits" class="chart chart-lg no-margin">
                                                <div class="widget-body">
                                                        <div class="table-toolbar">
                                                            <a id="editabledatatable_new" href="/luckydog/designer/add"  class="addCat btn btn-default">
                                                                添加展品
                                                            </a>
                                                        </div>
                                                        <table class="table table-striped table-bordered table-hover" id="simpledatatable">
                                                            <thead>
                                                                <tr>
                                                                    <th style="width: 60px;">展品ID</th>
                                                                    <th>名称</th>
                                                                    <th>图片</th>
                                                                    <th>添加时间</th>
                                                                    <th>操作</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                            <?php if(!empty($designerlist)):?>
                                                            <?php foreach($designerlist as $key=> $row):?>
                                                                <tr class="gradeX">
                                                                    <td class="center" style="text-align:center;width:40px;"><?php echo $row['id'];?></td>
                                                                    <td class="center itemDetail" data-id = "<?php echo $row['id'];?>" ><?php echo $row['name'];?></td>
                                                                    <td class="center"><img src="<?=UPLOADURL.$row['imageurl']['imgurl'];?>" width="100"></td>
                                                                    <td class="center"><?php echo  date("Y-m-d",$row['addtime'])?></td>
                                                                    
                                                                    <td class="center "  data_id = "<?php echo $row['id'];?>">
                                                                        <a style="color:blue;" href="/luckydog/designer/edit?id=<?php echo $row['id']?>" >修改</a>&nbsp;|
                                                                        <a style="color:blue;" href="javascript:;" class="J_del">删除</a>
                                                                    </td>
                                                                </tr>
                                                        <?php endforeach;?>
                                                        <?php endif;?>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->
<script src="<?php echo STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script type="text/javascript">
     $(".J_del").click(function(){
            var id = $(this).parent().attr("data_id");
            if(confirm("确定删除吗?")){
                $.post("/luckydog/designer/do_del", {id:id}, function(data) {               
                    if (data.status) {     
                        layer.msg("删除成功");             
                        window.location.href = "/luckydog/designer";
                    }else{
                        layer.msg("删除失败");
                        window.location.reload();
                    }
                }, "json");

            }                 
            
        });
</script>



